<template>
  <div role="tabpanel" class="tab-panel active" id="Message">
    <ul class="list-group">
      <li class="list-group-item" v-for="item in messages" :key="item.id">
        <router-link
          :to="{
            name: 'msgdetail',
            query: {
              content: item.content,
              id: item.id,
            },
          }"
          >{{ item.content }}</router-link
        >
      </li>
    </ul>
    <div class="alert alert-success" role="alert">
      <!-- 三级路由展示 -->
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "MessageC",
  data() {
    return {
      messages: [
        { id: 1, content: "吃饭" },
        { id: 2, content: "睡觉" },
        { id: 3, content: "不敲代码" },
      ],
    };
  },
};
</script>

<style scoped>
</style>
